﻿<Window x:Class="SMG.Presentation.WEnviarEmail"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="Enviar Emails" Height="471" Width="672" Loaded="Window_Loaded"
        WindowStartupLocation="CenterScreen">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="auto"/>
        </Grid.RowDefinitions>
        
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="381*" />
            <ColumnDefinition Width="269*" />
        </Grid.ColumnDefinitions>

        <Expander Grid.Row="0" Header="Filtros de Contato">
            <Grid Margin="5">
                <Grid.RowDefinitions>
                    <RowDefinition Height="25"/>
                    <RowDefinition/>
                </Grid.RowDefinitions>
                
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="auto"/>
                    <ColumnDefinition Width="auto"/>
                </Grid.ColumnDefinitions>
                
                <TextBlock Text="Nome :" VerticalAlignment="Center"/>
                <TextBox x:Name="txtNomeContato" TextChanged="txtNomeContato_TextChanged" VerticalAlignment="Center" Height="23" Grid.Column="1" Margin="5,0,-53,0" Width="318" />

                <ListView x:Name="lstContato" Grid.Row="1" Grid.ColumnSpan="2" Height="auto" SelectionMode="Single" MouseDoubleClick="lstContato_MouseDoubleClick" Margin="0,0,-53,0" Width="363">
                    <ListView.View>
                        <GridView>
                            <GridViewColumn  DisplayMemberBinding="{Binding Nome}" Header="Nome" Width="120"/>
                            <GridViewColumn  DisplayMemberBinding="{Binding Email}" Header="Email" Width="140"/>
                            <GridViewColumn  DisplayMemberBinding="{Binding Grupo.Nome}" Header="Grupo" Width="90"/>
                        </GridView>
                    </ListView.View>
                </ListView>
            </Grid>
        </Expander>

        <Expander Grid.Column="1" Header="Filtros de Grupo">
            <Grid Margin="5">
                <Grid.RowDefinitions>
                    <RowDefinition Height="25"/>
                    <RowDefinition/>
                </Grid.RowDefinitions>

                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="auto"/>
                    <ColumnDefinition Width="215"/>
                    <ColumnDefinition Width="53*" />
                </Grid.ColumnDefinitions>

                <TextBlock Text="Nome :" VerticalAlignment="Center"/>
                <TextBox x:Name="txtNomeGrupo" VerticalAlignment="Center" Height="23" Grid.Column="1" Margin="5,0,3,0" TextChanged="txtNomeGrupo_TextChanged" />

                <ListView x:Name="lstGrupo" Grid.Row="1" Grid.ColumnSpan="3" Height="auto" SelectionMode="Single" MouseDoubleClick="lstGrupo_MouseDoubleClick">
                    <ListView.View>
                        <GridView>
                            <GridViewColumn  DisplayMemberBinding="{Binding Nome}" Header="Nome" Width="240"/>
                        </GridView>
                    </ListView.View>
                </ListView>
            </Grid>
        </Expander>
        
        <Grid Grid.Row="1" Grid.ColumnSpan="2">
            <Grid.RowDefinitions>
                <RowDefinition/>
                <RowDefinition />
                <RowDefinition/>
            </Grid.RowDefinitions>
            
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="auto"/>
                <ColumnDefinition/>
            </Grid.ColumnDefinitions>
            
            <Button Content="ENVIAR" HorizontalAlignment="Left" Margin="5" Grid.Row="0" Height="50" x:Name="btnSend" Width="75" Click="btnSend_Click" />

            <StackPanel Margin="5" Grid.Row="0" Grid.Column="1" Orientation="Horizontal">
                <TextBlock Text="Para: " VerticalAlignment="Top"/>
                <TextBox x:Name="txtDestino" Margin="5,0,0,0" Width="517" Height="48" VerticalAlignment="Center"/>
            </StackPanel>
            
            <StackPanel Margin="5" Grid.Row="1" Grid.Column="1" Orientation="Horizontal">
                <TextBlock Text="Assunto: " VerticalAlignment="Top"/>
                <TextBox x:Name="txtAssunto" Margin="5,0,0,0" Width="300" Height="23" VerticalAlignment="Top"/>
                <CheckBox x:Name="chkTodos" VerticalAlignment="Center" Margin="5,0,0,0" Content="Enviar para todos de uma vez."/>
            </StackPanel>
            
            <RichTextBox x:Name="txtCorpo" VerticalScrollBarVisibility="Visible" Height="250"  Grid.Row="2" Grid.ColumnSpan="2" UseLayoutRounding="False" />
        </Grid>
    </Grid>
</Window>
